package cn.com.code.design.user.impl;

import cn.com.code.design.user.User;
import cn.com.code.design.visitor.Visitor;

import java.util.Random;

/**
 * @author zhengpei
 * @date 2021/11/4
 */
public class Student extends User {

  public Student(String name, String identity, String clazz) {
    super(name, identity, clazz);
  }

  @Override
  public void accept(Visitor visitor) {
    visitor.visit(this);
  }

  public int ranking() {
    return (int) (Math.random() * 100);
  }

  public int count() {
    return 105 - new Random().nextInt(10);
  }

}
